<!--
 * @Author: your name
 * @Date: 2020-12-18 16:07:10
 * @LastEditTime: 2020-12-18 16:33:28
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \basicjs\kongjian\kongjian1.html
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>视口文档</title>
    <style>
        #app{
            width: 200px;
            height: 200px;
            padding: 20px;
            margin: 20px;
            border: 10px solid #ddd;
            overflow: auto;
        }
    </style>
</head>
<body>
    <div id="app"></div>

    <span>网页很多都是多屏，所以文档尺寸一般大于视口尺寸,当打开控制台后，视口尺寸相应变小。网页很多都是多屏，所以文档尺寸一般大于视口尺寸,当打开控制台后，视口尺寸相应变小。网页很多都是多屏，所以文档尺寸一般大于视口尺寸,当打开控制台后，视口尺寸相应变小。</span>

    <script>
        //当前视口的宽度【包括滚动条】
        // console.log(window.innerWidth);
        // //当前视口的高度
        // console.log(window.innerHeight);

        // console.log(document.documentElement.clientWidth);

        // console.log(document.documentElement.clientHeight);

        //getBoundingClientRect

        // let app = document.querySelector('#app');
        // let pos = app.getBoundingClientRect();
        // console.log(pos);

        // let span = document.querySelector('span');
        // let info = span.getClientRects();
        // console.log(info);

        


    </script>
</body>
</html>